// index.js

Page({ 
  data:{//页面初始化数据
    name:'张三',
    age:20,
  },
  dahai(e){
    wx.navigateTo({
      url: '/pages/dahai/index',
    })
  },
  showMessage:function(e){
    console.log("showmessage...",e)
  },
  setUserMessage(e){//设置用户信息
    this.setData({//动态设置页面数据
      userName:"张三丰",
      userAge:28,
    })
  },
  agePlus1(e){
    let userAge=this.data.userAge//获取原来的年龄
    ++userAge
    this.setData({userAge})//相当于{userAge:userAge}
    
  }
})
